#include "widget.h"
#include "ui_widget.h"
#include <QString>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    void (Widget::*SignalWithParam)(QString) = &Widget::MySignal;
    void (Widget::*SlotsWithParam)(QString) = &Widget::MySlots;

    connect(this, SignalWithParam, this, SlotsWithParam);

    emit MySignal("发射成功");
}

Widget::~Widget()
{
    delete ui;
}

void Widget::MySlots(QString str)
{
    qDebug() << str;
}

